package org.come.control;

import org.come.Frame.BoothBoxJframe;
import org.come.Frame.StallBuyJframe;
import org.come.action.FromServerAction;
import org.come.baitan.BaiTanJframe;
import org.come.baitan.GouMaizhuFrame;
import org.come.until.FormsManagement;
import org.come.until.GsonUtil;

import com.tool.Stall.Stall;
import com.tool.image.ImageMixDeal;

public class StallControl implements FromServerAction {

	@Override
	public void controlMessFromServer(String mes, String type) {
		final Stall stall = (Stall)GsonUtil.getGsonUtil().getgson().fromJson(mes, Stall.class);
		if (stall.getRoleid().compareTo(ImageMixDeal.userimg.getRoleShow().getRole_id()) == 0) {
			//
			//  BoothBoxJframe.getBoothboxjframe().getBoothboxjpanel().shuaxing(stall);
			BaiTanJframe.getBaiTanJframe().getBaiTanJpanel().updata(stall);
			FormsManagement.HideForm(2260);
			FormsManagement.showForm(2260);

		}
		else {
			if (!GouMaizhuFrame.getGouMaizhuFrame().getGouMaiJpanel().isVisible()){
				GouMaizhuFrame.getGouMaizhuFrame().getGouMaiJpanel().updateLabels(stall,0,1,false);
			}else {
				GouMaizhuFrame.getGouMaizhuFrame().getGouMaiJpanel().updateLabels(stall,0,1,true);
				FormsManagement.showForm(2261);
			}


			//  StallBuyJframe.getStallBuyJframe().getStallBuyJpanel().initstall(stall);
		}
	}

}
